home *** CD-ROM | disk | FTP | other *** search
/ PC Play 129 / pc play 129.iso / Demo / man2 / man2.exe / scenarios / train / Train 10.scl < prev   
Encoding:
Text File  |  2005-03-07  |  11.1 KB  |  361 lines

  1. scenario = GetProperties()
  2. scenario.ScenarioType = 1
  3. scenario.Title = "sc_Train_10_00"
  4. scenario.Map = "Beotorum.dat"
  5. scenario.Description = "sc_Train_10_01"
  6. scenario.iSortOrder = 5
  7. scenario.Picture = "Train 10.dds"
  8.  
  9. scenario.vShowMessageBoxes[STDDT_GUERILLA] = false
  10. scenario.vShowMessageBoxes[STDDT_INITIAL_DISCLOSE] = false
  11. scenario.vShowMessageBoxes[STDDT_ORDINARY_DICLOSE] = false
  12. scenario.vShowMessageBoxes[STDDT_COMBAT_PHASE] = false
  13. scenario.vShowMessageBoxes[STDDT_SHOW_REVENUE] = false
  14. scenario.vShowMessageBoxes[STDDT_AUTOFINISH_GUERILLA] = false
  15. scenario.vShowMessageBoxes[STDDT_AUTOFINISH_COMBAT] = false
  16. scenario.vShowMessageBoxes[STDDT_AUTOFINISH_REVENUE] = false
  17. scenario.vShowMessageBoxes[STDDT_AUTOFINISH_DISCLOSE] = false
  18. scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_CAPITAL] = false
  19. scenario.vShowMessageBoxes[STDDT_YOU_CLEARED_TERRITORY] = false
  20. scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_COUNTRY] = false
  21. scenario.vShowMessageBoxes[STDDT_YOU_GOT_INDEMNITY] = false
  22. scenario.vShowMessageBoxes[STDDT_ENEMY_CLEARED_TERRITORY] = false
  23. scenario.vShowMessageBoxes[STDDT_ENEMY_INVADED] = false
  24. scenario.vShowMessageBoxes[STDDT_ENEMY_CAPTURED_COUNTRY] = false
  25. scenario.vShowMessageBoxes[STDDT_ENEMY_DISCLOSE] = false
  26. scenario.vShowMessageBoxes[STDDT_DICLOSE_COUNTRY] = false
  27. scenario.vShowMessageBoxes[STDDT_INVADE_COUNTRY] = false
  28.  
  29. Player(PT_PLAYER, RACE_HUMANS)
  30. Player(PT_AI, RACE_ALIENS)
  31.  
  32. SetInitialCamera(-0.321461, 0.000000, 0.946923, 0.000000, -0.818337, 0.503138, -0.277809, 0.000000,-0.476432, -0.864206, -0.161739, 0.000000,921.238403, 322.401733, -588.098572, 1.000000)
  33.  
  34. function InitialMOB()
  35.     StartMOB(1)
  36.  
  37.     ShowXBallon(53, -1, MBS_CENTER, 300, 300, "sc_Train_10_02")
  38.  
  39.     ShowXBallon(53, -1, MBS_CENTER, 300, 300, "sc_Train_10_03")
  40.  
  41.     InitCameraPointsList()
  42.     AddCameraPoint(-0.991251, 0.000000, 0.131989, 0.000000, -0.115614, 0.482438, -0.868267, 0.000000,-0.063677, -0.875930, -0.478217, 0.000000,1114.590068, 343.047882, -956.012268, 1.000000)
  43.     AddCameraPoint(-0.958943, -0.000000, 0.283596, 0.000000, -0.280194, 0.154431, -0.947440, 0.000000,-0.043796, -0.988003, -0.148090, 0.000000,1358.987183, 401.407166, -1087.509521, 1.000000)
  44.     FlyCameraByPoints(1)
  45.  
  46.     ShowXBallon(53, -1, MBS_CENTER, 300, 300, "sc_Train_10_04")
  47.  
  48.     ShowXBallon(53, -1, MBS_CENTER, 300, 300, "sc_Train_10_05")
  49.  
  50.     MoveUnit( 4098, 22, 34 )
  51.  
  52.     ShowXBallon(53, -1, MBS_CENTER, 300, 900, "sc_Train_10_06")
  53.  
  54.     ShowXBallon(53, -1, MBS_CENTER, 300, 900, "sc_Train_10_07")
  55.  
  56.     MoveUnit( 2, 22, 38 )
  57.     MoveUnit( 4, 23, 37 )
  58.     pause(3)
  59.     MoveUnit( 3, 23, 39 )
  60.  
  61.     ShowXBallon(53, -1, MBS_CENTER, 300, 900, "sc_Train_10_08")
  62.  
  63.     ShowXBallon(53, -1, MBS_CENTER, 300, 900, "sc_Train_10_09")
  64.  
  65.     FlyCamera(-0.698618, 0.000000, 0.715495, 0.000000, -0.692449, 0.251756, -0.676116, 0.000000,-0.180130, -0.967791, -0.175882, 0.000000,1471.120361, 429.965515, -1097.210815, 1.000000)
  66.  
  67.     ShowXBallon(53, -1, MBS_CENTER, 300, 900, "sc_Train_10_10")
  68.  
  69.     FinishMOB()
  70. end
  71.  
  72. old_prompt = ""
  73.  
  74. local bCanEndPhase = false
  75.  
  76. function OnUpdate()
  77.     bCanEndPhase = false
  78.  
  79.     if GetTurnNumber( COLOR_GREEN ) == 0 then
  80.         if not IsInside( 4099 ) then
  81.             if GetSelectedUnit() ~= 4099 then
  82.                 ShowPrompting("sc_Train_10_11")
  83.             else
  84.                 ShowPrompting("sc_Train_10_12")
  85.             end
  86.         elseif not IsInside( 4100 ) then
  87.             if GetSelectedUnit() ~= 4100 then
  88.                 ShowPrompting("sc_Train_10_13")
  89.             elseif GetDistance( 4100, 4098 ) > 1 then
  90.                 ShowPrompting("sc_Train_10_14")
  91.             else
  92.                 ShowPrompting("sc_Train_10_15")
  93.             end
  94.         elseif GetMP( 4098 ) > 0 and ( GetPos( 4098 ).x ~= 17 or GetPos( 4098 ).y ~= 31 ) then
  95.             if GetSelectedUnit() ~= 4098 then
  96.                 ShowPrompting("sc_Train_10_16")
  97.             elseif IsDesantInfoDisplaying() then
  98.                 ShowPrompting("sc_Train_10_17")
  99.             else
  100.                 ShowPrompting("sc_Train_10_18")
  101.             end
  102.         elseif not IsInside( 4101 ) then
  103.             if GetSelectedUnit() ~= 4101 then
  104.                 ShowPrompting("sc_Train_10_19")
  105.             else
  106.                 ShowPrompting("sc_Train_10_12")
  107.             end
  108.         elseif not IsInside( 4102 ) then
  109.             if GetSelectedUnit() ~= 4102 then
  110.                 ShowPrompting("sc_Train_10_21")
  111.             else
  112.                 ShowPrompting("sc_Train_10_22")
  113.             end
  114.         elseif GetPos( 4098 ).x ~= 16 or GetPos( 4098 ).y ~= 30 then
  115.             if GetSelectedUnit() ~= 4098 then
  116.                 ShowPrompting("sc_Train_10_16")
  117.             elseif IsDesantInfoDisplaying() then
  118.                 ShowPrompting("sc_Train_10_17")
  119.             else
  120.                 ShowPrompting("sc_Train_10_25")
  121.             end
  122.         end
  123.     else
  124.         for id = 4099, 4102 do
  125.             if not IsInside( id ) and GetDistance( id, 1 ) <= GetMaxWR( id ) then
  126.                 if not HasFired( id ) then
  127.                     ShowPrompting("sc_Train_10_26")
  128.                     return
  129.                 end
  130.             end
  131.         end
  132.  
  133.         if GetPos( 4098 ).x ~= 13 or GetPos( 4098 ).y ~= 21 then
  134.             if GetSelectedUnit() ~= 4098 then
  135.                 ShowPrompting("sc_Train_10_16")
  136.             elseif IsDesantInfoDisplaying() then
  137.                 ShowPrompting("sc_Train_10_17")
  138.             else
  139.                 ShowPrompting("sc_Train_10_29")
  140.             end
  141.         elseif GetType( IsHexFull(12, 20) ) == TANK then
  142.             ShowPrompting("sc_Train_10_30")
  143.         elseif IsInside( 4099 ) or IsInside( 4101 ) then
  144.             if GetType( GetSelectedUnit() ) == TANK and IsInside( GetSelectedUnit() ) then
  145.                 ShowPrompting("sc_Train_10_31")
  146.             elseif IsDesantInfoDisplaying() then
  147.                 ShowPrompting("sc_Train_10_32")
  148.             else
  149.                 ShowPrompting("sc_Train_10_16")
  150.             end
  151.         elseif IsInside( 4100 ) then
  152.             if GetSelectedUnit() == 4100 then
  153.                 ShowPrompting("sc_Train_10_34")
  154.             elseif IsDesantInfoDisplaying() then
  155.                 ShowPrompting("sc_Train_10_35")
  156.             else
  157.                 ShowPrompting("sc_Train_10_16")
  158.             end
  159.         elseif IsInside( 4102 ) then
  160.             if GetSelectedUnit() == 4102 then
  161.                 ShowPrompting("sc_Train_10_37")
  162.             elseif IsDesantInfoDisplaying() then
  163.                 ShowPrompting("sc_Train_10_38")
  164.             else
  165.                 ShowPrompting("sc_Train_10_16")
  166.             end
  167.         end
  168.     end
  169.  
  170.     if not HasPrompting() then
  171.         ShowPrompting("sc_Train_finish_phase")
  172.         bCanEndPhase = true
  173.     end
  174. end
  175.  
  176. function OnHexClicked(x, y, clicked_unit, selected_unit, command)
  177.     if command == CMD_LOAD and ( IsInside( 4101 ) or IsInside( 4102 ) ) then
  178.         pause()
  179.         stop()
  180.         StartMOB(1)
  181.         ShowXBallon(53, -1, MBS_CENTER, 300, 300, "sc_Train_10_41")
  182.         ShowXBallon(53, -1, MBS_CENTER, 300, 320, "sc_Train_10_42")
  183.         FinishMOB()
  184.     elseif command == CMD_LOAD and selected_unit == 4100 then
  185.         pause()
  186.         stop()
  187.  
  188.         StartMOB(1)
  189.         FlyCamera(-0.888584, 0.000000, 0.458713, 0.000000, -0.452474, 0.164369, -0.876498, 0.000000,-0.075398, -0.986399, -0.146055, 0.000000,1194.484863, 494.967957, -1092.769653, 1.000000)
  190.         ShowObject(ARROW, 1, 65280, 50, 25, 16, 30, 17, 31)
  191.         ShowXBallon(51, -1, MBS_CENTER, 300, 350, "sc_Train_10_43")
  192.         HideObject(1)
  193.         
  194.         FinishMOB()
  195.     end
  196.  
  197.     if command == CMD_FIRE and clicked_unit ~= 1 then
  198.         IncorrectAction("sc_Train_10_44")
  199.         return
  200.     end
  201.  
  202.     if GetTurnNumber( COLOR_GREEN ) == 0 then
  203.         if command == CMD_MOVE then
  204.             if selected_unit == 4099 or selected_unit == 4101 or selected_unit == 4102 then
  205.                 IncorrectAction("sc_Train_10_45")
  206.             elseif selected_unit == 4100 then
  207.                 local p = GetPos( 4100 )
  208.                 if p.x ~= 23 or y ~= 35 then
  209.                     if x ~= 23 or y ~= 35 then
  210.                         IncorrectAction("sc_Train_10_46")
  211.                     end
  212.                 else
  213.                     IncorrectAction("sc_Train_10_45")
  214.                 end
  215.             elseif selected_unit == 4098 then
  216.                 if not IsInside( 4099 ) or not IsInside( 4100 ) then
  217.                     IncorrectAction("sc_Train_10_51")
  218.                 elseif not IsInside( 4101 ) or not IsInside( 4102 ) then
  219.                     if x ~= 17 or y ~= 31 then
  220.                         IncorrectAction("sc_Train_10_49")
  221.                     end
  222.                 else
  223.                     if x ~= 16 or y ~= 30 then
  224.                         IncorrectAction("sc_Train_10_49")
  225.                     end
  226.                 end
  227.             end
  228.         elseif command == CMD_UNLOAD then
  229.             IncorrectAction("sc_Train_10_51")
  230.         end
  231.     elseif GetTurnNumber( COLOR_GREEN ) == 1 then
  232.         if selected_unit == 4098 then
  233.             if command == CMD_MOVE then
  234.                 if x ~= 13 or y ~= 21 then
  235.                     IncorrectAction("sc_Train_10_52")
  236.                 end
  237.             end
  238.         elseif GetType( selected_unit ) == TANK then
  239.             if command == CMD_UNLOAD then
  240.                 if x == 13 and y == 19 then
  241.                     IncorrectAction("sc_Train_10_53")
  242.                 elseif x ~= 12 or y ~= 20 then
  243.                     IncorrectAction("sc_Train_10_51")
  244.                 end
  245.             elseif command == CMD_MOVE then
  246.                 if GetDistance( 1, x, y ) > 1 then
  247.                     IncorrectAction("sc_Train_10_51")
  248.                 end
  249.             end
  250.         elseif selected_unit == 4100 then
  251.             if command == CMD_MOVE or command == CMD_UNLOAD then
  252.                 if GetDistance( 1, x, y ) > 2 then
  253.                     IncorrectAction("sc_Train_10_56")
  254.                 end
  255.             end
  256.         elseif selected_unit == 4102 then
  257.             if command == CMD_MOVE or command == CMD_UNLOAD then
  258.                 if GetDistance( 1, x, y ) > 2 then
  259.                     IncorrectAction("sc_Train_10_57")
  260.                 end
  261.             end
  262.         end
  263.     end
  264. end
  265.  
  266. function OnUnitDead(unit)
  267.     if unit == 1 then
  268.         StartMOB(1)
  269.         ShowXBallon(53, -1, MBS_CENTER, 300, 300, "sc_Train_10_58")
  270.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_10_59")
  271.         ShowXBallon(51, -1, MBS_CENTER, 300, 500, "sc_Train_10_60")
  272.         ShowXBallon(51, -1, MBS_CENTER, 300, 500, "sc_Train_10_61")
  273.         ShowXBallon(51, -1, MBS_CENTER, 300, 500, "sc_Train_10_62")
  274.         ShowXBallon(51, -1, MBS_CENTER, 300, 500, "sc_Train_10_63")
  275.         ShowXBallon(51, -1, MBS_CENTER, 300, 500, "sc_Train_10_64")
  276.         FinishMOB()
  277.     end
  278. end
  279.  
  280. function OnEndTurn()
  281.     StartMOB( 1 )
  282.     SetMP(2, 0)
  283.     SetMP(3, 0)
  284.     SetMP(4, 0)
  285.     FinishMOB()
  286. end
  287.  
  288. function OnBeginPhase(phase)
  289.     if GetTurnNumber( COLOR_GREEN ) == 1 then
  290.         if phase == PHASE_COMBAT then
  291.             StartMOB(1)
  292.             FlyCamera(0.837925, 0.000000, 0.545786, 0.000000, -0.541839, 0.120047, 0.831865, 0.000000,-0.065520, -0.992768, 0.100590, 0.000000,971.832336, 658.708984, -930.020020, 1.000000)
  293.             ShowObject(ARROW, 1, 65280, 100, 50, 14, 24, 13, 21)
  294.             ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_10_65")
  295.             HideObject(1)
  296.             FinishMOB()
  297.         end
  298.     end
  299. end
  300.  
  301. function OnEndAITurn()
  302.     if GetTurnNumber( COLOR_GREEN ) == 1 then
  303.         StartMOB( 1 )
  304.         FlyCamera(-0.758360, 0.000000, 0.651835, 0.000000, -0.637716, 0.207011, -0.741933, 0.000000,-0.134937, -0.978339, -0.156989, 0.000000,1282.112427, 518.751343, -1054.979736, 1.000000)
  305.         MoveUnit( 2, 21, 31 )
  306.         pause(3)
  307.         LoadUnit( 3, 4 )
  308.         MoveUnit( 3, 19, 31 )
  309.         UnloadUnit( 3, 4, 18, 30 )
  310.         MoveUnit( 4, 17, 29 )
  311.         Fire( 4, 4098 )
  312.         pause(3)
  313.         ShowXBallon(53, -1, MBS_CENTER, 300, 340, "sc_Train_10_66")
  314.         ShowXBallon(53, -1, MBS_CENTER, 300, 300, "sc_Train_10_67")
  315.         ShowXBallon(53, -1, MBS_CENTER, 300, 300, "sc_Train_10_68")
  316.         RemoveDead()
  317.         FinishMOB()
  318.     end
  319. end
  320.  
  321. function OnEndPhase( phase )
  322.     if phase == PHASE_COMBAT then
  323.         if not bCanEndPhase then
  324.             IncorrectAction("sc_Train_10_51")
  325.         end
  326.     end
  327. end
  328.  
  329. function CheckForVictory()
  330.     if IsDead( 1 ) then return GAMERESULT_VICTORY end
  331.     if GetAliveUnitsAmount( COLOR_GREEN ) == 0 then return GAMERESULT_DEFEAT end
  332.     return GAMERESULT_NONE
  333. end
  334.  
  335. function aiDefence(country)
  336.     aiMustNot()
  337. end
  338.  
  339. function InitialSetup()
  340.  
  341. Country(2, ALLIANCE_NEUTRAL_FNU)
  342. Money(2, MONEY_TOTAL_REVENUE, 0)
  343. Country(17, ALLIANCE_NEUTRAL_FNU)
  344. Money(17, MONEY_TOTAL_REVENUE, 0)
  345.  
  346. Country(15, ALLIANCE_NEUTRAL_FL)
  347. Money(15, MONEY_TOTAL_REVENUE, 0)
  348.  
  349. SetupUnit( 1, GTOWERA, 11, 17 )
  350. SetupUnit( 2, BSHIPA, 21, 45 )
  351. SetupUnit( 3, NTRANSPA, 20, 48 )
  352. SetupUnit( 4, AMPHIBIAA, 22, 42 )
  353.  
  354. SetupUnit( 4098, NTRANSP, 24, 44 )
  355. SetupUnit( 4099, TANK, 23, 35 )
  356. SetupUnit( 4100, HBOT, 24, 34 )
  357. SetupUnit( 4101, TANK, 18, 32 )
  358. SetupUnit( 4102, MORTAR, 17, 33 )
  359.  
  360. end
  361.